package com.cjmp.hao.testmoduledemo_windows;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.cjmp.hao.testmoduledemo_windows.databinding.ActivityMainBinding;
import com.cjmp.hao.moduledemo_windows.EntryEntryAbilityActivity;
import ohos.stage.ability.adapter.StageActivity;

public class MainActivity extends Activity {

    private ActivityMainBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        Button bt = binding.button;
        bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, EntryEntryAbilityActivity.class);
                intent.putExtra("params",
                        "{\"params\":[{\"key\":\"keyfirst\",\"type\":1,\"value\":\"keyvalue\"}," +
                        "{\"key\":\"keysecond\",\"type\":9,\"value\":\"2.3\"}," +
                        "{\"key\":\"keythird\",\"type\":5,\"value\":\"2\"}," +
                        "{\"key\":\"keyfourth\",\"type\":10,\"value\":\"test\"}]}");
                startActivity(intent);
            }
        });
    }
}